<!DOCTYPE HTML>
<html class="fn">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>易控-受控文件下载</title>
		<link rel="stylesheet" href="/static/js/bootstrap/css/bootstrap.min.css" type="text/css"/>
		<link rel="stylesheet" type="text/css" href="/static/css/waifa.css">
		<link rel="stylesheet" type="text/css" href="/static/css/down_home.css">
	</head>
	<body>
		<div class="wf">
			<div class="wf_header">
				<div class="logo">
					<a target="_self" href="/home" class="logo-bd">易控</a>
				</div>
			</div>
			<div class="wf_main">
				<div class="tool-view">
				</div>
				<div class="main">
					<table style="width:100%;height:100%">
						<tbody>
							<tr valign="middle" style="height:80%;">
								<td>
									<div id="down" class="down-box">
										<div class="down_view" style="display:none">
											<div class="icon">
												<div class='down-{$suffix|default:""}'></div>
											</div>
											<div class="down">
												<a class="btn"  href="/file_s/d?rid={$res_id|default:''}" target="_blank">
													立即下载
												</a>
											</div>
											
											<div class="name" title='{$filename|default:""}'>
												{$filename|default:""}
											</div>
											<div class="size">
												文件大小：<span>{$size|default:""}</span>
											</div>
										</div>
										<div class="err_txt" style="display:none">
											该<span class="tip">文件</span><span class="errmsg">{{$errmsg|default:""}}</span>!
										</div>
										<div class="system" style="display:none" >
											<div class="err">
												<div class="txt">
													目前该文件只可以在 <span class="tip">Windows</span>系统中使用
												</div>
											</div>
											<p class="help"><a href="/helpcenter?active=2" target="_blank">查看帮助</a> 或者 <a href="javascript:;" class="down_link">下载</a></p>
										</div>
									</div>
								</td>
							</tr>
							<tr valign="bottom" style="height:20%;">
								<td>
									<div class="footer">
										©2016 易控.︱粤ICP备14084662号-2  版权
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="/static/js/jquery/jquery.js"></script>
		<script type="text/javascript">
		{literal}
			jQuery(function() {
				function getQueryString(name) {
				    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				    var r = window.location.search.substr(1).match(reg);
				    if (r != null) return unescape(r[2]); return null;
				}
				var uuid = getQueryString('uuid');
					
				$('#down').on("click",".btn",function(){
					$.getJSON("/down_home/update",{'uuid': uuid},function(jsonData){
											
					});
					$.get('/trace/save_trace', {'event' : 5, 'uuid' : uuid});
				});

				var downContainer= $("#down");
				var errMsg = downContainer.find(".errmsg");
				if(errMsg.html() != ""){
					errMsg.parent().css("display","block");
					return;
				}

				if(navigator.userAgent.indexOf("Window")<0)
				{
					var system = downContainer.find(".system");
					system.css("display","block");

					var down_link = system.find(".down_link");
					down_link.click(function(){
						$("#down .system").hide();
						$("#down .down_view").show();
					})
					return;
				}
				
				var downView = downContainer.find(".down_view");
				downView.css("display","block");
				
				
				
				
			}); 
		{/literal}
		</script>
	</body>
</html>